Skip to content

Add the possibility to insert .args files for compiling complex contracts#200

Merged
apoelstra merged 1 commit intoBlockstreamResearch:masterfrom
ikripaka:feature/args-param
Feb 11, 2026
Merged

Add the possibility to insert .args files for compiling complex contracts#200
apoelstra merged 1 commit intoBlockstreamResearch:masterfrom
ikripaka:feature/args-param

Conversation

@ikripaka
Copy link
Copy Markdown
Contributor

@ikripaka ikripaka commented Jan 26, 2026

This pr adds --args field for compiling complex programs.
You can use the CLI to compile contracts such as those written in https://github.com/BlockstreamResearch/simplicity-contracts.

  • add --args for .args file
  • move default second witness file parameter to --wit

For example, arguments for option.simf

    {
        "TAKER_FUNDING_START_TIME": {
            "value": "1769163845",
            "type": "u32"
        }, "SETTLEMENT_ASSET_ID": {
            "value": "0xa5502895799e276b4af246c821423b4ed5ec5e6b4e6df7a861606939d9a2fc38",
            "type": "u256"
        }, "FEE_BASIS_POINTS": {
            "value": "0",
            "type": "u64"
        }, "EARLY_TERMINATION_END_TIME": {
            "value": "1769163835",
            "type": "u32"
        }, "FILLER_PER_SETTLEMENT_COLLATERAL": {
            "value": "11",
            "type": "u64"
        }, "INCENTIVE_BASIS_POINTS": {
            "value": "1000",
            "type": "u64"
        }, "GRANTOR_SETTLEMENT_TOKEN_ASSET": {
            "value": "0x1f58afc32aa70a012a9ebf30a543148be00aec1b371f9793a153c274acce2de5",
            "type": "u256"
        }, "COLLATERAL_ASSET_ID": {
            "value": "0x6d521c38ec1ea15734ae22b7c46064412829c0d0579f0a713d1c04ede979026f",
            "type": "u256"
        },"FILLER_PER_SETTLEMENT_ASSET": {
            "value": "110",
            "type": "u64"
        }, "FILLER_PER_PRINCIPAL_COLLATERAL": {
            "value": "10",
            "type": "u64"
        }, "GRANTOR_SETTLEMENT_PER_DEPOSITED_ASSET": {
            "value": "110",
            "type": "u64"
        }, "GRANTOR_PER_SETTLEMENT_COLLATERAL": {
            "value": "11",
            "type": "u64"
        }, "ORACLE_PK": {
            "value": "0x531fe6068134503d2723133227c867ac8fa6c83c537e9a44c3c5bdbdcb1fe337",
            "type": "u256"
        }, "GRANTOR_COLLATERAL_PER_DEPOSITED_COLLATERAL": {
            "value": "1",
            "type": "u64"
        }, "SETTLEMENT_HEIGHT": {
            "value": "0",
            "type": "u32"
        }, "FILLER_TOKEN_ASSET": {
            "value": "0x3c3fe87795809f74ed54005e0e50395fdc3b2862048641f439bd4ba6ca009502",
            "type": "u256"
        },"GRANTOR_PER_SETTLEMENT_ASSET": {
            "value": "110",
            "type": "u64"
        },"FEE_SCRIPT_HASH": {
            "value": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "type": "u256"
        }, "TAKER_FUNDING_END_TIME": {
            "value": "1769163855",
            "type": "u32"
        }, "CONTRACT_EXPIRY_TIME": {
            "value": "1769163865",
            "type": "u32"
        }, "STRIKE_PRICE": {
            "value": "10",
            "type": "u64"
        },"GRANTOR_COLLATERAL_TOKEN_ASSET": {
            "value": "0x1c01566a1e789e1a3f84c73b2c04352d30008eb30d905a0f22ba3e1a5a835b6f",
            "type": "u256"
        }

    }

Partially related to these issues #196, #157.

PS
This PR does not intend to rewrite the CLI build using clap macros. It simply adds new functionality.

@ikripaka ikripaka requested a review from delta1 as a code owner January 26, 2026 10:33
@ikripaka
Copy link
Copy Markdown
Contributor Author

@KyrylR
@gerau

@ikripaka ikripaka force-pushed the feature/args-param branch 2 times, most recently from 1bcf854 to ec08b5e Compare January 26, 2026 16:15
@apoelstra
Copy link
Copy Markdown
Contributor

CI failures are real.

@apoelstra
Copy link
Copy Markdown
Contributor

Please squash your commits.

From CONTRIBUTING.md

Pull requests:
...

  • should not contain commits that undo changes introduced by previous commits
  • must consist of commits which each build and pass unit tests (we do not require linters, formatters, etc., to pass on each commit)

@ikripaka
Copy link
Copy Markdown
Contributor Author

Please squash your commits.

From CONTRIBUTING.md

Pull requests:
...

  • should not contain commits that undo changes introduced by previous commits
  • must consist of commits which each build and pass unit tests (we do not require linters, formatters, etc., to pass on each commit)

Yeah, I know about that, but I can’t just check my solution, because the CI needs approval to run.
It builds locally, but I’m not sure the CI will accept it.

@apoelstra
Copy link
Copy Markdown
Contributor

Needs rebase.

Also, sorry for the delay in reviewing. My local CI is complaining about the lockfiles needing to be updated, but I couldn't reproduce this outside of the CI environment, and then I was traveling.

@ikripaka
Copy link
Copy Markdown
Contributor Author

ok, 5 min

@apoelstra
Copy link
Copy Markdown
Contributor

apoelstra commented Feb 11, 2026

Okay, utack 3c384e1 and queued it up in my test system. There are a couple rust-bitcoin PRs in front of it. I'll keep an eye on it and try to get this through.

@apoelstra
Copy link
Copy Markdown
Contributor

Found the issue -- my local CI setup was trying to use all the lockfiles it could find in the repo, including bitcoind-tests/Cargo.lock, which obviously doesn't work to build the root.

Should be good now and I should have a real ACK and merge within the next hour or so. Sorry again for the delays.

Copy link
Copy Markdown
Contributor

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3c384e1; successfully ran local tests

@apoelstra apoelstra merged commit 37fedc4 into BlockstreamResearch:master Feb 11, 2026
10 checks passed
@ikripaka ikripaka deleted the feature/args-param branch February 12, 2026 08:13
KyrylR added a commit that referenced this pull request Mar 17, 2026
d552c1c Bump simplicity-hl version, update changelog (Kyryl R)

Pull request description:

  The PR is about rolling out features that were added previously, they include (copy from the CHANGELOG.md):

  * Migrate from the `pest` parser to a new `chumsky`-based parser, improving parser recovery and enabling multiple parse errors to be reported in one pass [#185](#185)
  * `simc` now accepts `--args <file>` for parameterized contracts, and witness input is supplied explicitly via `--wit <file>` [#200](#200)
  * Expose contract ABI metadata for tooling via `simc --abi`, and add library accessors for parameter and witness types [#201](#201), [#219](#219)
  * Improve compiler diagnostics further by rejecting duplicate type-alias definitions and fixing parser recovery around angle-bracket-delimited syntax [#221](#221), [#222](#222)
  * Correct LSP hover/completion documentation for `build_tapleaf_simplicity`, `unwrap_left`, and `unwrap_right` [#229](#229), [#230](#230)

  ---

  I've decided to bump a minor version because of the `chumsky` migration, as far as I can see, it is a breaking change

  Even though we did our best to test the new parser on the contracts we are working on, there could still be some nuances. Therefore, I added a release candidate suffix to make the rollout softer

  Also, guys from Simplex are blocked, as they need a new version of SimplicityHL to be published in order to publish the Simplex framework to crates.io

ACKs for top commit:
  Arvolear:
    ACK [`d552c1c`](d552c1c), tested locally.
  delta1:
    utACK d552c1c

Tree-SHA512: c4629251714efe0d05bcdf29c24270bcb6feb9883b2fe1f784718b554ab6d4afb688d920256489f5f71f9fab81e9d34150755da2566ded94c87cdc4cb3d73da0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants